<?php

/**
 * HostDeck - Web Hosting Automation
 * http://code.google.com/p/hostdeck
 * --------------------------------------------
 * Last Modified:		March 10, 2012 @ 12:40 P.M.
 * Core Version:		1.0.0
 * Graph API Version:	1.0.0
 * Component Version:	1.0.0
 */

class settings {
	
	private $con;
	
	public function getval($con, $setting) {
		####
		### Developer Note
		## The variable $con must be a valid MySQL resource link.
		###
		####
		// Let's work on the connection by making
		// $con private to avoid confusion
		$this->con = $con;
		
		// Get the setting ID and clean it
		$setting = trim(stripslashes($setting));
		
		// Prepare the SQL query
		$pquery = sprintf("SELECT * FROM settings WHERE id='%s';", mysql_real_escape_string($setting));
		
		// Send the query
		$mquery = mysql_query($pquery, $this->con);
		
		// Fetch Results
		$data = mysql_fetch_array($mquery, MYSQL_ASSOC);
		
		// Free Results
		mysql_free_result($mquery);
		
		// Return Data
		return $data;
	}
	
}

?>